<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="sitemesh" uri="http://www.opensymphony.com/sitemesh/decorator" %>
<%@ taglib prefix="tags" tagdir="/WEB-INF/tags" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>

<div class="panel_container">

    <div class="panel">
        <form id="form_search">
            <div class="panel_header">
                <div><h2>贷款记录</h2></div>
            </div>

            <div class="panel_footer">
                <div>
                    <div class="info_item ml_1">
                        <input type="button" class="btn_blue" value="查询" id="btn_search">&nbsp;
                        <input id="back" class="btn_blue" type="button" value="返回">
                    </div>
                </div>
            </div>
        </form>
    </div>

    <div class="panel">
        <div class="panel_body">
            <div>
                <table id="grid_tbl"></table>
                <div id="pager"></div>
            </div>
        </div>
    </div>
</div>

<script type="text/javascript">
    function goback(){
        linkTo("${ctx}/mbt/toHistory");
    }

    function refreshList(){
        $("#grid_tbl").jqGrid('setGridParam',{postData:$("#form_search").serializeObject()}).trigger("reloadGrid");
    }

    $(function () {
        $("#back").bind("click", function(){
            goback();
        });

        $("#btn_search").bind("click", function(){
            refreshList();
        });

        $("#grid_tbl").jqGrid({
            datatype: "json",
            url : "${ctx}/mbt/loanView?historyId=${historyId}",
            mtype: "POST",
            width:"100%",
            height:"100%",
            colNames: ['贷款借据号','贷款卡编号','企业名称','组织机构代码',"数据时间"],
            colModel: [
                {name: 'dkjjh', index: 'dkjjh',sortable:false},
                {name: 'cardNo', index: 'cardNo',sortable:false},
                {name: 'qymc', index: 'qymc',sortable:false},
                {name: 'zzjgdm', index: 'zzjgdm',sortable:false},
                {name: 'sjsj', index: 'sjsj',sortable:false}
            ],
            rowNum: 10,
            rowList:[10,20,30],
            pager: '#pager',
            imgpath: 'images',
            sortname: 'id',
            viewrecords: true,
            sortorder: "desc",
            autowidth:true,
            jsonReader: {
                repeatitems : false,
                id: "id"
            },
            caption: "贷款记录列表"
        });

    });

</script>